﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HRModel;
using HRDAO.EO;
namespace HRDAO.Profiles
{
   public class StudentProfile: Profile
    {
        public StudentProfile()
        {
            //增删改 Dto->EO
            CreateMap<StudentDto, Student>()
                .ForMember(eo => eo.Id, (map) => map.MapFrom(dto => dto.Id))
                .ForMember(eo => eo.Name, (map) => map.MapFrom(dto => dto.Name));

            //查询 Eo->Dto
            CreateMap<Student, StudentDto>()
                .ForMember(dto => dto.Id, (map) => map.MapFrom(eo => eo.Id))
                .ForMember(dto => dto.Name, (map) => map.MapFrom(eo => eo.Name));
        }
    }
}
